#include<vector>
using namespace std;
class Solution {
public:
    vector<int> sortedSquares(vector<int>& nums) {
        int n = nums.size();
        vector<int> ret(n);
        for (int i = 0; i < n; i++)ret[i] = nums[i] * nums[i];
        sort(ret.begin(), ret.end());
        return ret;

    }
};